home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-05-01 | 1.2 KB | 46 lines | [TEXT/MMCC] |
- // C translation by Adam Wight
-
- #include "SAT.h"
-
- FacePtr GetFaceFromPICT (int colorPICTid,int bwPICTid,int maskPICTid);
-
- /*No error checking yet!*/
-
- FacePtr GetFaceFromPICT (int colorPICTid,int bwPICTid,int maskPICTid) {
- Rect bounds;
- PicHandle thePICT, maskPICT;
- FacePtr theFace;
- SATPort savePort;
-
- SATGetPort(&savePort);
-
- /*Get PICTs*/
- if (gSAT.initDepth > 1) thePICT = GetPicture(colorPICTid);
- else thePICT = GetPicture(bwPICTid);
-
- maskPICT = GetPicture(maskPICTid);
- bounds = (*thePICT)->picFrame;
- OffsetRect(&bounds, -bounds.left, -bounds.top); /* Unnecessary? I think NewFace does this for us. /Ingemar */
-
- /*Create face*/
- theFace = SATNewFace(&bounds);
-
- /*Draw in the face*/
- SATSetPortFace(theFace);
- DrawPicture(thePICT, &bounds);
- SATSetPortMask(theFace);
- DrawPicture(maskPICT, &bounds);
- /*Tell SAT that we are done*/
- SATChangedFace(theFace);
-
- /*Get rid of the PICTs*/
- ReleaseResource((Handle)thePICT);
- ReleaseResource((Handle)maskPICT);
-
- /*Return the face.*/
-
- SATSetPort(&savePort);
-
- return theFace;
- }
-